<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

<f:view contentType="text/html;charset=UTF-8" encoding="UTF-8">
    <h:head>

    </h:head>

    <h:body>

        <h:form id="form">
            <p:messages id="messages" showDetail="true" showSummary="true">
                <p:autoUpdate/>
            </p:messages>

            <h:panelGrid columns="2" id="matchGrid" cellpadding="5">
                <p:outputLabel for="@next" value="Password 1:"/>
                <p:password id="pwd1" value="#{password004.value}" match="pwd2" label="Password 1" required="true"/>

                <p:outputLabel for="@next" value="Password 2:"/>
                <p:password id="pwd2" value="#{password004.value}" label="Password 2" required="true"/>
            </h:panelGrid>

            <p:commandButton id="button" value="Save" update="matchGrid"/>
        </h:form>

    </h:body>
</f:view>

</html>